//
//  Square.h
//  INFSWA02
//
//  Created by Justin van Grootveld on 9/15/11.
//  Copyright 2011 Pro4all. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Board.h"

@class Piece;

@interface Square : NSObject
{
    Board *_board;
    NSColor *_color;
    NSPoint _location;
    Piece *_piece;
    NSButton *_button;
}

@property (nonatomic, assign, readonly) Board *board;
@property (nonatomic, assign, readonly) NSPoint location;
@property (nonatomic, assign) NSColor *color;
@property (nonatomic, assign) NSButton *button;

- (id)initWithBoard:(Board *)board andLocation:(NSPoint)location;
- (Piece *)piece;
- (BOOL)setPiece:(Piece *)piece;
- (void)removePiece;
- (BOOL)hasPiece;
- (BOOL)hasPieceOwnedByCurrentPlayer;

- (void)setButtonTitle;

- (BOOL)isInMoveRangeOfSquareWithPiece:(Square *)square;
- (BOOL)isInAttackRangeOfSquareWithPiece:(Square *)square;

- (NSMutableArray *)squaresWhichCanBeAttacked;
- (NSMutableArray *)squaresWhichCanBeMovedAt;

@end
